<?php

/**
52zll.top
 */

if(!defined('IN_DISCUZ')) {
	exit('Access Denied');
}

$sql = <<<EOF

DROP TABLE IF EXISTS `pre_dzapp_zhibo_activity`;
CREATE TABLE `pre_dzapp_zhibo_activity` (
  `activity_id` mediumint(8) NOT NULL AUTO_INCREMENT,
  `name` varchar(200) NOT NULL DEFAULT '',
  `start_time` varchar(20) NOT NULL DEFAULT '',
  `end_time` varchar(20) NOT NULL DEFAULT '',
  `cover_img_url` varchar(200) NOT NULL DEFAULT '',
  `live_num` tinyint(2) unsigned NOT NULL DEFAULT '1',
  `code_rate` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `need_record` tinyint(1) unsigned NOT NULL DEFAULT '1',
  `need_time_shift` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `need_full_view` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `activity_category` varchar(10) NOT NULL DEFAULT '',
  `play_mode` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `activityid` varchar(25) NOT NULL DEFAULT '',
  `end` tinyint(1) NOT NULL DEFAULT '0',
  `scroll_advert` varchar(255) NOT NULL DEFAULT '',
  `scroll_advert_url` varchar(255) NOT NULL DEFAULT '',
  `advert` varchar(255) NOT NULL DEFAULT '',
  `advert_url` varchar(255) NOT NULL DEFAULT '',
  `graphic_status` tinyint(1) NOT NULL DEFAULT '0',
  `manager` varchar(255) NOT NULL DEFAULT '',
  `praise` mediumint(8) NOT NULL DEFAULT '0',
  `tight` mediumint(8) unsigned zerofill NOT NULL,
  `tab_title` varchar(20) NOT NULL DEFAULT '',
  `tab_content` text NOT NULL,
  `dateline` int(10) unsigned NOT NULL DEFAULT '0',
  `ip` varchar(15) NOT NULL DEFAULT '',
  PRIMARY KEY (`activity_id`)
) ENGINE=MyISAM;

DROP TABLE IF EXISTS `pre_dzapp_zhibo_advert`;
CREATE TABLE `pre_dzapp_zhibo_advert` (
  `advert_id` mediumint(8) NOT NULL AUTO_INCREMENT,
  `title` varchar(255) NOT NULL,
  `pic` varchar(255) NOT NULL,
  `url` varchar(255) NOT NULL,
  `activity_id` mediumint(8) NOT NULL,
  `describe` text NOT NULL,
  `dateline` int(10) NOT NULL,
  `ip` varchar(15) NOT NULL,
  PRIMARY KEY (`advert_id`)
) ENGINE=MyISAM;

DROP TABLE IF EXISTS `pre_dzapp_zhibo_comment`;
CREATE TABLE `pre_dzapp_zhibo_comment` (
  `comment_id` mediumint(8) NOT NULL AUTO_INCREMENT,
  `table` varchar(75) NOT NULL DEFAULT '',
  `id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `uid` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `username` varchar(35) NOT NULL DEFAULT '',
  `message` text NOT NULL,
  `dateline` int(10) unsigned NOT NULL DEFAULT '0',
  `ip` varchar(15) NOT NULL DEFAULT '',
  PRIMARY KEY (`comment_id`)
) ENGINE=MyISAM;

DROP TABLE IF EXISTS `pre_dzapp_zhibo_gift`;
CREATE TABLE `pre_dzapp_zhibo_gift` (
  `gift_id` smallint(6) NOT NULL AUTO_INCREMENT,
  `name` varchar(75) NOT NULL DEFAULT '',
  `icon` varchar(175) NOT NULL DEFAULT '',
  `price` decimal(8,2) NOT NULL DEFAULT '0.00',
  `dateline` int(10) unsigned NOT NULL DEFAULT '0',
  `ip` varchar(15) NOT NULL DEFAULT '',
  PRIMARY KEY (`gift_id`)
) ENGINE=MyISAM;

DROP TABLE IF EXISTS `pre_dzapp_zhibo_graphic`;
CREATE TABLE `pre_dzapp_zhibo_graphic` (
  `graphic_id` mediumint(8) NOT NULL AUTO_INCREMENT,
  `activity_id` mediumint(8) NOT NULL DEFAULT '0',
  `pic` varchar(255) NOT NULL DEFAULT '',
  `video_url` varchar(255) NOT NULL DEFAULT '',
  `name` varchar(125) NOT NULL DEFAULT '',
  `describe` text NOT NULL,
  `url` varchar(155) NOT NULL DEFAULT '',
  `uid` mediumint(8) NOT NULL DEFAULT '0',
  `username` varchar(30) NOT NULL DEFAULT '',
  `dateline` int(10) unsigned NOT NULL DEFAULT '0',
  `ip` varchar(15) NOT NULL DEFAULT '',
  PRIMARY KEY (`graphic_id`)
) ENGINE=MyISAM;

DROP TABLE IF EXISTS `pre_dzapp_zhibo_live`;
CREATE TABLE `pre_dzapp_zhibo_live` (
  `live_id` mediumint(8) NOT NULL AUTO_INCREMENT,
  `machine` tinyint(2) unsigned NOT NULL DEFAULT '0',
  `push_url` varchar(255) NOT NULL DEFAULT '',
  `status` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `stream_id` varchar(100) NOT NULL DEFAULT '',
  `play_query` varchar(255) NOT NULL DEFAULT '',
  `dateline` int(10) unsigned NOT NULL DEFAULT '0',
  `ip` varchar(15) NOT NULL DEFAULT '',
  `activity_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `liveid` varchar(100) NOT NULL DEFAULT '',
  `start_time` varchar(20) NOT NULL DEFAULT '',
  `end_time` varchar(20) NOT NULL DEFAULT '',
  `taskid` varchar(100) NOT NULL DEFAULT '',
  PRIMARY KEY (`live_id`)
) ENGINE=MyISAM;

DROP TABLE IF EXISTS `pre_dzapp_zhibo_order`;
CREATE TABLE `pre_dzapp_zhibo_order` (
  `order_id` mediumint(8) NOT NULL AUTO_INCREMENT,
  `activity_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `uid` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `username` varchar(35) NOT NULL DEFAULT '',
  `gift_id` smallint(6) unsigned NOT NULL DEFAULT '0',
  `price` decimal(8,2) NOT NULL DEFAULT '0.00',
  `pay_time` int(10) unsigned NOT NULL DEFAULT '0',
  `dateline` int(10) unsigned NOT NULL DEFAULT '0',
  `ip` varchar(15) NOT NULL DEFAULT '',
  PRIMARY KEY (`order_id`)
) ENGINE=MyISAM;

DROP TABLE IF EXISTS `pre_dzapp_zhibo_user`;
CREATE TABLE `pre_dzapp_zhibo_user` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `uid` int(10) NOT NULL DEFAULT '0',
  `username` varchar(24) NOT NULL,
  `openid` varchar(48) NOT NULL,
  `appid` varchar(20) NOT NULL,
  `wxusername` varchar(24) NOT NULL,
  `lat` varchar(15) NOT NULL,
  `lng` varchar(15) NOT NULL,
  `bindtime` int(10) NOT NULL DEFAULT '0',
  `firsttime` int(10) NOT NULL DEFAULT '0',
  `updatetime` int(10) NOT NULL DEFAULT '0',
  `currentdata` text NOT NULL,
  `ssid` int(10) NOT NULL,
  `access_token` varchar(32) NOT NULL,
  `subscribe` tinyint(1) unsigned NOT NULL DEFAULT '1',
  `nickname` varchar(255) NOT NULL,
  `sex` tinyint(1) unsigned NOT NULL DEFAULT '0',
  `city` varchar(255) NOT NULL DEFAULT '',
  `country` varchar(255) NOT NULL DEFAULT '',
  `province` varchar(255) NOT NULL DEFAULT '',
  `language` varchar(255) NOT NULL DEFAULT '',
  `headimgurl` varchar(255) NOT NULL DEFAULT '',
  `subscribe_time` int(10) unsigned NOT NULL DEFAULT '0',
  `unionid` varchar(255) NOT NULL DEFAULT '',
  `remark` varchar(255) NOT NULL DEFAULT '',
  `groupid` mediumint(8) unsigned NOT NULL DEFAULT '0',
  `invite` smallint(6) NOT NULL DEFAULT '0',
  `method` varchar(255) NOT NULL DEFAULT '',
  `device` varchar(255) NOT NULL DEFAULT '',
  `ip` varchar(15) NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
) TYPE=MyISAM;
EOF;

runquery($sql);

$finish = TRUE;

?>